package com.jt.sp04.feign;

import com.jt.sp01.pojo.User;
import com.jt.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "USER-SERVICE")
public interface UserClient {
    @GetMapping("getUser/{userId}")
    JsonResult<User> getUser(@PathVariable(value = "userId") Integer userId);

    @GetMapping("/{userId}/score")
    JsonResult addScore(@PathVariable("userId") Integer userId, @RequestParam("score") Integer score);
}
